package countor;
/**
 * 定制阻塞计数器计数,最大计数Long.MAX_VALUE
 * @author dingnate
 */
public class UserLoginCountor implements ICountor<User> {
	private User user;

	private long loginCount = 0;

	public UserLoginCountor(User user) {
		super();
		this.user = user;
	}

	/**
	 * @return the user
	 */
	public User getUser() {
		return user;
	}

	@Override
	public String toString() {
		return "UserCounter [" + "loginCount=" + loginCount + ", user=" + user + "]";
	}

	@Override
	public void incr() {
		++loginCount;
	}

	@Override
	public Long getCount() {
		return loginCount;
	}

	@Override
	public User getOwner() {
		return user;
	}
}